package com.sws.quartz.task;

import com.sws.device.service.IDevDeviceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 设备信息定时任务
 * 
 * @author sws
 */
@Component("devDeviceTask")
public class DevDeviceTask {
    
    private static final Logger log = LoggerFactory.getLogger(DevDeviceTask.class);
    
    @Autowired
    private IDevDeviceService devDeviceService;
    
    /**
     * 定时清理被逻辑删除的设备信息
     * 每天执行一次，物理删除那些被标记为逻辑删除的设备记录
     */
    public void cleanLogicalDeletedDevices() {
        log.info("开始执行设备信息清理任务");
        int count = devDeviceService.physicalDeleteLogicalDeletedDevices();
        log.info("设备信息清理任务完成，共清理 {} 条记录", count);
    }
} 